Media Service API Documentation
Endpoint
- Method: POST
- Path:
https://api.kadal.ai/media-services/api/v1/ - Summary: Extracts transcription, description, metadata, and thumbnail from a media file.
Description
This endpoint processes a single audio or video file to generate multiple outputs, including transcription of speech, a descriptive summary, technical metadata, and a thumbnail image. It enables comprehensive analysis and representation of media content in a single request.
Request
- Content-Type: multipart/form-data
Payload
| Parameter | Description | Data Type | Is Optional |
|---|---|---|---|
| choice_model_selection | AI model selection (whisper) | String | No |
| media_type | Select the type of uploaded file (audio/video) | String | No |
| input_media | Upload a single audio/video file | File (.mp3, .mp4, .mpeg, .wav, .webm) | No |
| description | Enable detailed description generation | boolean | Yes |
| description_length | Desired length of generated description (25-500) | integer | Yes |
| metadata | Enable metadata generation | boolean | Yes |
| thumbnail | Enable thumbnail generation (only supported for video files) | boolean | Yes |
Response
{
"status_code": 200,
"message": "SUCCESS::MediaService generated successfully",
"file_name": "Your filename will appear here",
"transcription": "Transcription will appear here",
"description_text": "Description will appear here",
"metadata_output": {
"title": "Title will appear here",
"description": "Description will appear here",
"genre": ["Genre will appear here"],
"creator": "Creator will appear here",
"keywords": ["Keywords will appear here"],
"custom": "custom will appear here"
},
"thumbnail_output": "Thumbnail will appear here"
}
Usage
import requests
url = "https://api.kadal.ai/media-services/api/v1/"
file_path = "your file path here"
token = "your token here"
headers = {
"accept": "application/json",
"Authorization": f"Bearer {token}",
}
data = {
"choice_model_selection": "whisper",
"media_type": "audio",
"description": "true",
"description_length": "225",
"metadata": "true",
"thumbnail": "false",
}
files = {
"input_media": (file_path, open(file_path, "rb"), "audio/wav"),
}
response = requests.post(url, headers=headers, data=data, files=files)